# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         hmwk02
# Description:  继承
# Author:       asus
# Date:         2019/3/16
#-------------------------------------------------------------------------------


# 作业要求
# 三个类：有一个是人，老师，学生继承自人
# 老师去教工食堂吃饭，住在家里或教工宿舍，老师讲课
# 学生去普通食堂吃饭，住学生宿舍，学生上课
# 共有属性：姓名，年龄，性别，身高，体重
# 定义有方法和特有方法各三个，特有属性定义一个以上（薪水，学费）

class Person:
    def __init__(self,name,age,sex,height,weight):
        self.name = name
        self.age = age
        self.sex = sex
        self.height = height
        self.weight = weight

    def getheight(self):
        # 获取身高
        return self.height

    def getage(self):
        # 获取年龄
        return self.age

    def greet(self):
        # 打招呼
        return "Hello {name}".format(name = self.name)


class Teacher(Person):
    def __init__(self,salary,subject,level):
        self.salary = salary
        self.subject = subject
        self.level = level

    def getsalary(self):
        return self.salary
    pass



class Student(Person):
    pass


if __name__ == '__main__':
    t = Teacher(5000,'English',1)
    t.professor = 4000
    print((t.getsalary() + t.professor))